//引入路由组件
// import Home from '@/views/Home'
// import Login from '@/views/Login'
// import Register from '@/views/Register'
// import Search from '@/views/Search'
// import Detail from '@/views/Detail'
// import AddCartSuccess from '@/views/AddCartSuccess'
// import ShopCart from '@/views/ShopCart'
// import Trade from '@/views/Trade'
// import Pay from '@/views/Pay'
// import PaySuccess from '@/views/PaySuccess'
// import Center from '@/views/Center'
// import PersonalOrder from '@/views/Center/PersonalOrder'
// import GroupOrder from '@/views/Center/GroupOrder'

export default [{
    path: '/',
    component: () =>
        import ('@/views/Home'),
    meta: {
        footerShow: true
    }
}, {
    path: '/home',
    component: () =>
        import ('@/views/Home'),
    meta: {
        footerShow: true
    }
}, {
    path: '/login',
    component: () =>
        import ('@/views/Login'),
    meta: {
        footerShow: false
    }
}, {
    path: '/register',
    component: () =>
        import ('@/views/Register'),
    meta: {
        footerShow: false
    }
}, {
    name: 'searchName',
    path: '/search/:keyWord?',
    component: () =>
        import ('@/views/Search'),
    props: true,
    meta: {
        footerShow: true
    }
}, {
    name: 'detailName',
    path: '/detail/:skuId',
    component: () =>
        import ('@/views/Detail'),
    meta: {
        footerShow: true
    }
}, {
    name: 'addCartSuccessName',
    path: '/addCartSuccess',
    component: () =>
        import ('@/views/AddCartSuccess'),
    meta: {
        footerShow: true
    }
}, {
    name: 'shopCartName',
    path: '/shopCart',
    component: () =>
        import ('@/views/ShopCart'),
    meta: {
        footerShow: true
    },

}, {
    name: 'tradeName',
    path: '/trade',
    component: () =>
        import ('@/views/Trade'),
    beforeEnter: (to, from, next) => {
        // 只有当从购物车页面跳转时，才放行
        if (from.path == '/shopCart') {
            next()
        } else { next(false) }
    },
    meta: {
        footerShow: true
    },
}, {
    name: 'payName',
    path: '/pay',
    component: () =>
        import ('@/views/Pay'),
    meta: {
        footerShow: true
    },
}, {
    name: 'paySuccessName',
    path: '/paySuccess',
    component: () =>
        import ('@/views/PaySuccess'),
    meta: {
        footerShow: true
    },
}, {
    name: 'centersName',
    path: '/center',
    component: () =>
        import ('@/views/Center'),
    meta: {
        footerShow: true
    },
    children: [{
        path: 'personalOrder',
        component: () =>
            import ('@/views/Center/PersonalOrder'),
    }, {
        path: 'groupOrder',
        component: () =>
            import ('@/views/Center/GroupOrder'),
    }, {
        path: '/center',
        redirect: '/center/personalOrder'
    }],

}]